package cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseengineeringdetail.PurchaseEngineeringDetailRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseequipmentdetail.PurchaseEquipmentDetailRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchasematerialdetail.PurchaseMaterialDetailRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseminordetail.PurchaseMinorDetailRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseservicedetail.PurchaseServiceDetailRespVO;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 采购计划 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PurchasePlanRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11924")
    private Long id;

    @Schema(description = "采购计划名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
    @ExcelProperty("采购事项名称")
    private String planName;

    @Schema(description = "采购计划编号(系统自动生成)")
    @ExcelProperty("采购事项编号")
    private String planNo;

    @Schema(description = "采购类型", example = "SERVICE/EQUIPMENT/ENGINEERING/MATERIAL/DIRECT/MINOR", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "采购需求类型（6类）", converter = DictConvert.class)
    @DictFormat("purchase_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String purchaseType;

    @Schema(description = "预算归属部门ID", example = "9338")
    private Long budgetDepartmentId;

    @Schema(description = "预算归属部门名称", example = "赵六")
    @ExcelProperty("预算归属部门")
    private String budgetDepartmentName;

    @Schema(description = "需求申请部门ID", example = "30026")
    private Long applicationDepartmentId;

    @Schema(description = "需求申请部门名称", example = "王五")
    @ExcelProperty("需求使用部门")
    private String applicationDepartmentName;

    @Schema(description = "需求申请人ID", example = "25967")
    private Long applicantId;

    @Schema(description = "需求申请人姓名", example = "张三")
    private String applicantName;

    @Schema(description = "采购方式")
    @DictFormat("purchase_method") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String purchaseMethod;

    @Schema(description = "项目名称")
    private String projectName;

    @Schema(description = "质保期/维保期")
    private String warrantyPeriod;

    @Schema(description = "原合同期限开始时间")
    private LocalDateTime originalContractStartTime;

    @Schema(description = "原合同期限结束时间")
    private LocalDateTime originalContractEndTime;

    @Schema(description = "原合同金额(万元)")
    private BigDecimal originalContractAmount;

    @Schema(description = "合同履约情况")
    private String contractPerformance;

    @Schema(description = "本次采购预估单价来源说明")
    private String estimatedPriceSource;

    @Schema(description = "需到货时间")
    private LocalDateTime requiredDeliveryTime;

    @Schema(description = "施工时间")
    private LocalDateTime constructionTime;

    @Schema(description = "施工工期开始时间")
    private LocalDateTime constructionStartTime;

    @Schema(description = "施工工期结束时间")
    private LocalDateTime constructionEndTime;

    @Schema(description = "施工期间负责人")
    private String constructionLeader;

    @Schema(description = "是否含有非标配件(0-否 1-是)")
    private Boolean hasNonStandardParts;

    @Schema(description = "是否含暂列金(0-否 1-是)")
    private Boolean hasProvisionalSum;

    @Schema(description = "实施小组组成及分工")
    private String implementationTeam;

    @Schema(description = "谈判报价方式")
    private String negotiationMethod;

    @Schema(description = "供应商选择原则")
    private String supplierSelectionPrinciple;

    @Schema(description = "项目理由及必要性说明", example = "不喜欢")
    private String projectReason;

    @Schema(description = "备注说明", example = "你说的对")
    private String remark;

    @Schema(description = "采购申请开始时间")
    private LocalDateTime applicationStartTime;

    @Schema(description = "采购申请结束时间")
    private LocalDateTime applicationEndTime;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    @Schema(description = "只有是服务类采购时才是必填")
    private List<PurchaseServiceDetailRespVO> serviceDetailRespVOS;

    @Schema(description = "只有是小额采购时才是必填")
    private List<PurchaseMinorDetailRespVO> minorDetailRespVOS;

    @Schema(description = "只有是物料采购时才是必填")
    private List<PurchaseMaterialDetailRespVO> materialDetailRespVOS;

    @Schema(description = "只有是设备采购时才是必填")
    private List<PurchaseEquipmentDetailRespVO> equipmentDetailRespVOS;

    @Schema(description = "只有是工程采购时才是必填")
    private List<PurchaseEngineeringDetailRespVO> engineeringDetailRespVOS;

    @Schema(description = "审核状态")
    private Integer status;

    @Schema(description = "工作流关联id")
    private String processInstanceId;

}